package com.hqhsc.module.front.activity.service;

import com.hqhsc.module.common.service.ManageMemcacdedClient;
import com.hqhsc.module.front.activity.dao.VoteDao;
import com.hqhsc.module.front.activity.domain.Vote;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Properties;

/**
 *
 * @author jiangyin
 */
@Service
public class VoteService {

	static Logger logger = LoggerFactory.getLogger(VoteService.class);

	@Autowired
	private ManageMemcacdedClient memcachedClient;
	@Autowired
	private VoteDao voteDao;
    @Autowired
    private Properties appProps;

    /**
     * 获取投票活动，作品列表
     * @param activity_id
     * @return
     */
    public List<Vote> getProductList(long activity_id) {
        return this.voteDao.getPorductList(activity_id);
    }

    /**
     * 获取投票活动，作品详细
     * @param id
     * @return
     */
    public Vote getPordcutById(long id) {
        return this.voteDao.getProductById(id);
    }

    /**
     * 执行投票
     * @param id
     * @return
     */
    public int doVote(long id) {
        //TODO 投票规则


        return this.voteDao.doVote(id);
    }



}
